namespace Wizard.Compiler.Parsers
{
    /*
    public abstract class Evaluator
    {
		
        internal System.Collections.Generic.List<Import> mImportsList;
        private object mThis;
        private MRU mMRU;
        protected Parser mParser;
        private static System.Collections.Generic.Dictionary<Type, IEvalType> mTypes = new System.Collections.Generic.Dictionary<Type, IEvalType>();
		
        public Evaluator()
        {
            mMRU = new MRU();
            mImportsList = new System.Collections.Generic.List<Import>;
        }
		
        public Parser Parser
        {
            get
            {
                return mParser;
            }
        }
		
        public IEvalType EvalType(Type systemType)
        {
            IEvalType res = null;
            if (mTypes.TryGetValue(systemType, res))
            {
                return res;
            }
            else
            {
                res = new EvalType(this, systemType);
                mTypes(systemType) = res;
                return res;
            }
        }
		
		
        public int MRUCapacity
        {
            get
            {
                return mMRU.Capacity;
            }
            set
            {
                mMRU.Capacity = Value;
            }
        }
		
        public void ClearCache()
        {
            mMRU.Clear();
        }
		
		
        public void SetThis(object @this)
        {
            if (! @this == mThis)
            {
                mThis = @this;
            }
        }
		
        public Import FindImport(string name)
        {
            foreach (Import imp in mImportsList)
            {
                if (string.Equals(imp.Name, name, mParser.StringComparison))
                {
                    return imp;
                }
            }
            return null;
        }
		
        public IEvalType FindType(string name)
        {
            foreach (Import imp in mImportsList)
            {
                Type t = Type.GetType(imp.Name + "." + name, false, mParser.CaseSensitive == false);
                if (t != null)
                {
                    return this.EvalType(t);
                }
            }
            return null;
        }
		
        public void AddNameSpace(string ns)
        {
            if (ns == null)
            {
                return;
            }
            if (FindImport(ns) == null)
            {
                mImportsList.Add(new Import(eImportType.}}namespace, ns, null, null));
            }
            else
            {
                throw (new Exception("Namespace " + ns + " already exists"));
            }
        }
		
        public void RemoveNamespace(string ns)
        {
            Import imp = FindImport(ns);
            if (imp != null&& imp.ImportType == eImportType.namespace)
            {
                mImportsList.Remove(imp);
            }
        }
		
        public void AddSharedFunction(IEvalType t)
        {
            string ns = t.FullName;
            if (FindImport(ns) == null)
            {
                mImportsList.Add(new Import(eImportType.sharedFunction, ns, t, null));
            }
            else
            {
                throw (new Exception("Namespace " + ns + " already exists"));
            }
        }
		
        public void AddDatabase(string name, string provider, string connectionString)
        {
            if (FindImport(name) == null)
            {
                Database db = new Database(this, name, provider, connectionString);
                mImportsList.Add(new Import(eImportType.database, name, db.EvalType(), db));
            }
            else
            {
                throw (new Exception("Namespace " + name + " already exists"));
            }
        }
		
        public void RemoveSharedFunction(IEvalType t)
        {
            string ns = t.FullName;
            Import imp = FindImport(ns);
            if (imp != null&& imp.ImportType == eImportType.namespace)
            {
                mImportsList.Remove(imp);
            }
        }
		
        public virtual Wizard.opCode Parse(string str)
        {
            return mParser.Parse(str);
        }
		
        public virtual Wizard.opCode ParseText(string str)
        {
            return mParser.ParseText(str);
        }
		
        public virtual object Eval(string str)
        {
            return mParser.Parse(str).Value();
        }
		
        public virtual statements.MainBlock Parsestatements(string str)
        {
            return mParser.Parsestatements(str);
        }
		
        public static string ConvertToString(object value)
        {
            if (value is string)
            {
                return ((string) value);
            }
            else if (value == null)
            {
                return string.Empty;
            }
            else if (value is DateTime)
            {
                DateTime d = (DateTime) value;
                if (d.TimeOfDay.TotalMilliseconds > 0)
                {
                    return d.ToString();
                }
                else
                {
                    return d.ToShortDateString();
                }
            }
            else if (value is double)
            {
                double d = (double) value;
                if ((d % 1) != 0)
                {
                    return d.ToString("#,##0.00");
                }
                else
                {
                    return d.ToString("#,##0");
                }
            }
            else if (value is object)
            {
                return value.ToString;
            }
            return string.Empty;
        }
		
        internal static object FindVariableInBag(iVariableBag bag, string varname)
        {
            return bag.GetVariable(varname);
        }
		
    }
    */
}